import request from "@/utils/request";

export const loadApi = ({pageNum, pageSize, name}) => {
  return request({
    url: 'admin/selectPage',
    method: 'GET', 
    params: {
      pageNum,
      pageSize,
      name,
    }
  });
}
export const addApi = (form) => {
  return request({
    url: 'admin/add',
    method: 'POST',
    data: form
  })
}
export const updateAdminApi = (form) => {
  return request({
    url: 'admin/update',
    method: 'PUT',
    data: form
  })
}
export const deleteApi = (id) => {
  return request({
      url: `admin/deleteById/${id}`,
      method: 'DELETE',
  })
}

export const deleteBatchApi = (ids) => {
  return request({
      url: 'admin/deleteBatch' ,
      method: 'DELETE',
      data:ids
  })
}
